import os
import sys

Import("env")

env = env.Clone()

# Since filter.h is part of the win32 lib, we need to prepend this path instead
# of appending it.
env.PrependUnique(CPPPATH="#/lib")
env.AppendUnique(LIBPATH="#/lib")
env.AppendUnique(LIBS=["babelpod"])
env.Tool("qt4")
env.EnableQt4Modules(["QtGui", "QtCore"])
env.Uic4(Glob("*.ui"))
env.Ts4(["translations/babelpod_fr"], [Glob("*.cpp"), Glob("*.h"), Glob("*.ui")])
qm_node = env.Qm4(["translations/babelpod_fr"], Glob("*.ts"))
qrc_node = env.Qrc4("babelpod")
env.Depends(qrc_node, qm_node)
babelpod = env.Program("babelpod", Glob("*.cpp")+Glob("*.qrc"))
env.Install("$PREFIX/bin" if sys.platform != "win32" else "$PREFIX", babelpod)
Return("babelpod")
